package com.spider.ask120.action;

import org.jdiy.core.App;
import org.jdiy.core.JDiyAction;

import com.spider.ask120.service.ChannelArticleInfoService;
import com.spider.ask120.webmagic.history.Baike;
import com.spider.ask120.webmagic.history.Jibing;
import com.spider.ask120.webmagic.history.Jingyan;
import com.spider.ask120.webmagic.history.PinDao;
import com.spider.ask120.webmagic.history.Zixun;

public class SpiderAction extends JDiyAction{
	App app = App.get();
	private static String BAIKE_URL = "http://m.120ask.com/baike/";
	private static String JIBING_URL = "http://m.120ask.com/jibing/";
	private static String JINGYAN_URL = "http://m.120ask.com/jingyan/list/";
	private static String PINDAO_URL = "http://m.120ask.com/healthart/wx_art_home_all/";
	private static String ZIXUN_URL = "http://m.120ask.com/news/";
	/**
	 * 健康百科
	 */
	public void runBaikeHistory(){ 
		Baike.runBaike(BAIKE_URL);
	}
	/**
	 * 疾病
	 */
	public void runJibingHistory(){
		Jibing.runJibing(JIBING_URL);
	}
	/**
	 * 健康经验
	 */
	public void runJingyanHistory(){
		Jingyan.runJingyan(JINGYAN_URL);
	}
	/**
	 *频道 
	 */
	public void runPindaoHistory(){
		PinDao.runPindao(PINDAO_URL);
	}
	/**
	 * 健康资讯
	 */
	public void runZixunHistory(){
		Zixun.runZixun(ZIXUN_URL);
	}
	/**
	 * 更新文章最新id到channel_article_info表
	 */
	public void updateChannelArticleInfoTable(){
		ChannelArticleInfoService.updateChannelArticleId();
	}
}
